package org.destiny.geocen.entity;

import org.destiny.geocen.R;
import org.destiny.geocen.ResourceUtil;

import android.graphics.Bitmap;

public class Brick implements Comparable<Brick> {
	public Type type;
	public boolean searched;
	public final Bitmap bitmap;

	public int col, row;

	public boolean mark;

	public Brick(Type type, int row, int col) {
		this.type = type;
		this.row = row;
		this.col = col;
		bitmap = type.bitmap;
	}

	public int compareTo(Brick another) {
		if (row != another.row)
			return another.row - row;
		else
			return another.col - col;
	}
	
	public static class Type {
		public final Bitmap bitmap;

		private Type(Bitmap bitmap) {
			this.bitmap = bitmap;
		}

		public static Type[] getTypes() {
			return new Type[] { new Type(ResourceUtil.getBitMap(R.drawable.brick01, 2)),
					new Type(ResourceUtil.getBitMap(R.drawable.brick02, 2)),
					new Type(ResourceUtil.getBitMap(R.drawable.brick03, 2)),
					new Type(ResourceUtil.getBitMap(R.drawable.brick04, 2)),
					new Type(ResourceUtil.getBitMap(R.drawable.brick05, 2)),
					new Type(ResourceUtil.getBitMap(R.drawable.brick06, 2)) };
		}
	}
}
